package com.example.hangzhou.welbeing.mytestdemoapp.animation.animationActivity;

import android.app.ActivityOptions;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.view.View;

import com.example.hangzhou.welbeing.mytestdemoapp.R;
import com.example.hangzhou.welbeing.mytestdemoapp.activity.RecyclerViewActivity;
import com.example.hangzhou.welbeing.mytestdemoapp.animation.animationAdapter.AnimatedTransitionsfiveAdapter;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * 杭州惟君医疗科技有限公司10
 * Created by 20433 on 2018/5/7
 *
 * @desc 东风山河绿，春已不折柳，繁花看不尽，处处惹人留
 * @desc 佛祖镇楼，bug辟容易
 */

public class AnimatedTransitionsfiveActivity extends AppCompatActivity {

    @Bind(R.id.activity_animation_transition_five_recyclerview_toolbar)
    Toolbar activityAnimationTransitionFiveRecyclerviewToolbar;
    @Bind(R.id.activity_animation_transition_five_recycler_view)
    RecyclerView activityAnimationTransitionFiveRecyclerView;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_animation_transition_five_recyclerview);
        ButterKnife.bind(this);

        LinearLayoutManager mLayoutManager = new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false);
        // 设置布局管理器
        activityAnimationTransitionFiveRecyclerView.setLayoutManager(mLayoutManager);
        AnimatedTransitionsfiveAdapter animatedTransitionsfiveAdapter = new AnimatedTransitionsfiveAdapter();
        // 设置adapter
        activityAnimationTransitionFiveRecyclerView.setAdapter(animatedTransitionsfiveAdapter);
        animatedTransitionsfiveAdapter.setOnItemClickListener(new AnimatedTransitionsfiveAdapter.OnItemClickListener() {
            @Override
            public void onItemClick(View view) {
                int position = activityAnimationTransitionFiveRecyclerView.getChildAdapterPosition(view);
                PageJump(position,view);
            }

            @Override
            public void onItemClickFirst(View view) {

            }
        });
    }

    private void PageJump(int position,View view) {

        switch (position) {
            case 0:
                Intent intent_01 = new Intent(AnimatedTransitionsfiveActivity.this, AnimatedTransitionsDetailsPageActivity.class);
                startActivity(intent_01, ActivityOptions.makeSceneTransitionAnimation(this).toBundle());
                break;
            case 1:
                Intent intent_02 = new Intent(AnimatedTransitionsfiveActivity.this, AnimatedTransitionsDetailsPageSlideActivity.class);
                startActivity(intent_02, ActivityOptions.makeSceneTransitionAnimation(this).toBundle());
                break;
            case 2:
                Intent intent_07 = new Intent(AnimatedTransitionsfiveActivity.this, TraditionalAnimationActivity.class);
                startActivity(intent_07);
                overridePendingTransition(R.anim.slide_right_in, R.anim.slide_left_out);
                break;
            case 3:
                Intent intent_03 = new Intent(AnimatedTransitionsfiveActivity.this, AnimatedTransitionsFourthActivity.class);
                startActivity(intent_03, ActivityOptions.makeSceneTransitionAnimation(this).toBundle());
                break;
            case 4:
                Intent intent_04 = new Intent(AnimatedTransitionsfiveActivity.this, TransitionNoteActivity.class);
                startActivity(intent_04);
                overridePendingTransition(R.anim.slide_right_in, R.anim.slide_left_out);
                break;
            case 5:
                Intent intent_05 = new Intent(AnimatedTransitionsfiveActivity.this, AnimatedSpreadActivity.class);
              //  startActivity(intent_05);
                startActivity(intent_05, ActivityOptions.makeSceneTransitionAnimation(AnimatedTransitionsfiveActivity.this).toBundle());
                break;
            case 6:
                Intent intent_06 = new Intent(AnimatedTransitionsfiveActivity.this, RecyclerViewActivity.class);
                startActivity(intent_06, ActivityOptions.makeSceneTransitionAnimation(AnimatedTransitionsfiveActivity.this, view, "shareNames").toBundle());
                break;
            case 7:
                break;
            case 8:
                break;
            case 9:
                break;

        }
    }
}
